using MongoDB.Driver;
using System;
using System.Configuration;
using SmartLink.Domain.MongoEntity;

namespace SmartLink.MongoHelper
{

    /// <summary>
    /// Mongo DB Context
    /// </summary>
    public interface IMongoDBRepositoryContext
    {
        /// <summary>
        /// Gets a <see cref="IMongoDBRepositoryContextSettings"/> instance which contains the settings
        /// information used by current context.
        /// </summary>
        IMongoDBRepositoryContextSettings Settings { get; }
        /// <summary>
        /// Gets the <see cref="MongoCollection"/> instance by the given <see cref="Type"/>.
        /// </summary>
        /// <param name="type">The <see cref="Type"/> object.</param>
        /// <returns>The <see cref="MongoCollection"/> instance.</returns>
        IMongoCollection<T> GetCollection<T>() where T : IEntity;

        /// <summary>
        /// 从MongoDB中清除所有类型为T的对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        void ClearSequence<T>();

        /// <summary>
        /// 获取类型T的对象的下一个序列
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        int getNextSequence<T>();
    }
}
